import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
	path: '/login',
	name: 'login',
	meta: {
		title: 'Login - 登录'
	},
	component: () => import('@/views/login.vue')
};

export const registerRouter = {
    path: '/register',
    name: 'register',
    meta: {
        title: '机构注册'
    },
    component: () => import('@/views/register/register.vue')
};

export const page404 = {
	path: '/*',
	name: 'error-404',
	meta: {
		title: '404-页面不存在'
	},
	component: () => import('@/views/error-page/404.vue')
};

export const page403 = {
	path: '/403',
	meta: {
		title: '403-权限不足'
	},
	name: 'error-403',
	component: () => import('@//views/error-page/403.vue')
};

export const page500 = {
	path: '/500',
	meta: {
		title: '500-服务端错误'
	},
	name: 'error-500',
	component: () => import('@/views/error-page/500.vue')
};

export const preview = {
	path: '/preview',
	name: 'preview',
	component: () => import('@/views/form/article-publish/preview.vue')
};

export const locking = {
	path: '/locking',
	name: 'locking',
	component: () => import('@/views/main-components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/user',
    component: Main,
    children: [
        { path: 'home', title: {i18n: 'home'}, name: 'home_index', component: () => import('@/views/home/home.vue') },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: () => import('@/views/own-space/own-space.vue') },
        { path: 'order/:order_id', title: '订单详情', name: 'order-info', component: () => import('@/views/advanced-router/component/order-info.vue') }, // 用于展示动态路由
        { path: 'shopping', title: '购物详情', name: 'shopping', component: () => import('@/views/advanced-router/component/shopping-info.vue') }, // 用于展示带参路由
        { path: 'message', title: '消息中心', name: 'message_index', component: () => import('@/views/message/message.vue') }
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
/*import User from '@/views/user/user.vue';
import Award from '@/views/award/award.vue';*/
export const appRouter = [
    /*{
        path: '/user',
        icon: 'key',
        name: 'user',
        title: '用户管理',
        component: Main,
        children: [{
            path: 'user',
            title: '用户管理',
            name: 'user-list',
            component: () => import('@/views/user/user.vue')
        }, {
            path: 'award',
            title: '奖状制作',
            name: 'award',
            component: () => import('@/views/award/award.vue')
        }]
    },*/{
        path: '/elementary',
        icon: 'key',
        name: 'elementary',
        title: '基本设置',
        component: Main,
        children: [{
        path: 'classes',
        title: '班级管理',
        name: 'classes-list',
        component: () => import('@/views/classes/classes.vue')
    },{
            path: 'teacherinfo',
            title: '教师管理',
            name: 'teacherinfo-list',
            component: () => import('@/views/teacherinfo/teacherinfo.vue')
        },{
        path: 'classroom',
            title: '教室管理',
            name: 'classroom',
            component: () => import('@/views/classroom/classroom.vue')
    },{
        path: 'ratepay',
            title: '纳税金额设定管理',
            name: 'ratepay-list',
            component: () => import('@/views/ratepay/ratepay.vue')
    }]
    },{
    path: '/teacher',
        icon: 'key',
        name: 'teacher',
        title: '教师管理',
        component: Main,
        children: [{
        path: 'teacherAttendance',
        title: '签到教师管理',
        name: 'teacherAttendance-list',
        component: () => import('@/views/teacherAttendance/teacherAttendance.vue')
},{
        path: 'teacherSupply',
            title: '停课教师管理',
            name: 'teacherSupply-list',
            component: () => import('@/views/teacherSupply/teacherSupply.vue')
    },{
        path: 'teacherSuspend',
            title: '代课教师管理',
            name: 'teacherSuspend-list',
            component: () => import('@/views/teacherSuspend/teacherSuspend.vue')
    },{
        path: 'teacherMoney',
            title: '教师课时结算',
            name: 'teacherMoney-list',
            component: () => import('@/views/teacherMoney/teacherMoney.vue')
    }]
}/*,{
        path: '/activity',
        icon: 'clipboard',
        name: 'activity',
        title: '活动管理',
        component: Main,
        children: [{ path: 'list', title: '活动管理', name: 'activity-list', component: () => import('@/views/activity/activity.vue') }]
    },{
        path: '/orders',
        icon: 'compose',
        name: 'orders',
        title: '订单管理',
        component: Main,
        children: [{ path: 'list', title: '订单管理', name: 'orders-list', component: () => import('@/views/orders/orders.vue') }]
    },{
        path: '/daren',
        icon: 'person',
        name: 'daren',
        title: '达人库',
        component: Main,
        children: [{ path: 'list', title: '达人库', name: 'daren-list', component: () => import('@/views/daren/daren.vue') }]
    },{
        path: '/audit',
        icon: 'android-home',
        name: 'audit',
        title: '机构管理',
        component: Main,
        children: [{ path: 'list', title: '机构管理', name: 'audit-list', component: () => import('@/views/register/audit/audit.vue') }]
    },{
        path: '/assess',
        icon: 'printer',
        name: 'assess',
        title: '评价管理',
        component: Main,
        children: [{ path: 'list', title: '评价管理', name: 'assess-list', component: () => import('@/views/assess/assess.vue') }]
    },/!*{
        path: '/training',
        icon: 'film-marker',
        name: 'training',
        title: '培训发起',
        component: Main,
        children: [{ path: 'list', title: '培训发起', name: 'training-list', component: () => import('@/views/training/training.vue') }]
    },*!/{
        path: '/article',
        icon: 'ios-paper-outline',
        name: 'article',
        title: '文章管理',
        component: Main,
        children: [{ path: 'list', title: '文章管理', name: 'article-list', component: () => import('@/views/article/article.vue') }]
    },{
        path: '/integral',
        icon: 'social-euro',
        name: 'integral',
        title: '积分管理',
        component: Main,
        children: [{
            path: 'integral',
            title: '积分管理',
            name: 'integral-list',
            component: () => import('@/views/integral/integral.vue')
        },{
            path: 'integralGrade',
            title: '积分等级划分',
            name: 'integralGrade-list',
            component: () => import('@/views/integralGrade/integralGrade.vue')
        }]
    },{
        path: '/coupon',
        icon: 'social-facebook',
        name: 'coupon',
        title: '优惠券管理',
        component: Main,
        children: [{ path: 'list', title: '优惠券管理', name: 'coupon-list', component: () => import('@/views/coupon/coupon.vue') }]
    },{
        path: '/member',
        icon: 'ios-people',
        name: 'member',
        title: '会员管理',
        component: Main,
        children: [{ path: 'list', title: '会员管理', name: 'member-list', component: () => import('@/views/member/member.vue') }]
    }*/
    /*{
        path: '/access',
        icon: 'key',
        name: 'access',
        title: '权限管理',
        component: Main,
        children: [
            { path: 'index', title: '权限管理', name: 'access_index', component: () => import('@/views/access/access.vue') }
        ]
    },
    {
        path: '/access-test',
        icon: 'lock-combination',
        title: '权限测试页',
        name: 'accesstest',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '权限测试页', name: 'accesstest_index', access: 0, component: () => import('@/views/access/access-test.vue') }
        ]
    },
    {
        path: '/international',
        icon: 'earth',
        title: {i18n: 'international'},
        name: 'international',
        component: Main,
        children: [
            { path: 'index', title: {i18n: 'international'}, name: 'international_index', component: () => import('@/views/international/international.vue') }
        ]
    },
    {
        path: '/component',
        icon: 'social-buffer',
        name: 'component',
        title: '组件',
        component: Main,
        children: [
            {
                path: 'text-editor',
                icon: 'compose',
                name: 'text-editor',
                title: '富文本编辑器',
                component: () => import('@/views/my-components/text-editor/text-editor.vue')
            },
            {
                path: 'md-editor',
                icon: 'pound',
                name: 'md-editor',
                title: 'Markdown编辑器',
                component: () => import('@/views/my-components/markdown-editor/markdown-editor.vue')
            },
            {
                path: 'image-editor',
                icon: 'crop',
                name: 'image-editor',
                title: '图片预览编辑',
                component: () => import('@/views/my-components/image-editor/image-editor.vue')
            },
            {
                path: 'draggable-list',
                icon: 'arrow-move',
                name: 'draggable-list',
                title: '可拖拽列表',
                component: () => import('@/views/my-components/draggable-list/draggable-list.vue')
            },
            {
                path: 'area-linkage',
                icon: 'ios-more',
                name: 'area-linkage',
                title: '城市级联',
                component: () => import('@/views/my-components/area-linkage/area-linkage.vue')
            },
            {
                path: 'file-upload',
                icon: 'android-upload',
                name: 'file-upload',
                title: '文件上传',
                component: () => import('@/views/my-components/file-upload/file-upload.vue')
            },
            {
                path: 'scroll-bar',
                icon: 'android-upload',
                name: 'scroll-bar',
                title: '滚动条',
                component: () => import('@/views/my-components/scroll-bar/scroll-bar-page.vue')
            },
            {
                path: 'count-to',
                icon: 'arrow-graph-up-right',
                name: 'count-to',
                title: '数字渐变',
                // component: () => import('@/views/my-components/count-to/count-to.vue')
                component: () => import('@/views/my-components/count-to/count-to.vue')
            },
            {
                path: 'split-pane-page',
                icon: 'ios-pause',
                name: 'split-pane-page',
                title: 'split-pane',
                component: () => import('@/views/my-components/split-pane/split-pane-page.vue')
            }
        ]
    },
    {
        path: '/form',
        icon: 'android-checkbox',
        name: 'form',
        title: '表单编辑',
        component: Main,
        children: [
            { path: 'artical-publish', title: '文章发布', name: 'artical-publish', icon: 'compose', component: () => import('@/views/form/article-publish/article-publish.vue') },
            { path: 'workflow', title: '工作流', name: 'workflow', icon: 'arrow-swap', component: () => import('@/views/form/work-flow/work-flow.vue') }

        ]
    },
    // {
    //     path: '/charts',
    //     icon: 'ios-analytics',
    //     name: 'charts',
    //     title: '图表',
    //     component: Main,
    //     children: [
    //         { path: 'pie', title: '饼状图', name: 'pie', icon: 'ios-pie', component: resolve => { require('@/views/access/access.vue') },
    //         { path: 'histogram', title: '柱状图', name: 'histogram', icon: 'stats-bars', component: resolve => { require('@/views/access/access.vue') }

    //     ]
    // },
    {
        path: '/tables',
        icon: 'ios-grid-view',
        name: 'tables',
        title: '表格',
        component: Main,
        children: [
            { path: 'dragableTable', title: '可拖拽排序', name: 'dragable-table', icon: 'arrow-move', component: () => import('@/views/tables/dragable-table.vue') },
            { path: 'editableTable', title: '可编辑表格', name: 'editable-table', icon: 'edit', component: () => import('@/views/tables/editable-table.vue') },
            { path: 'searchableTable', title: '可搜索表格', name: 'searchable-table', icon: 'search', component: () => import('@/views/tables/searchable-table.vue') },
            { path: 'exportableTable', title: '表格导出数据', name: 'exportable-table', icon: 'code-download', component: () => import('@/views/tables/exportable-table.vue') },
            { path: 'table2image', title: '表格转图片', name: 'table-to-image', icon: 'images', component: () => import('@/views/tables/table-to-image.vue') }
        ]
    },
    {
        path: '/advanced-router',
        icon: 'ios-infinite',
        name: 'advanced-router',
        title: '高级路由',
        component: Main,
        children: [
            { path: 'mutative-router', title: '动态路由', name: 'mutative-router', icon: 'link', component: () => import('@/views/advanced-router/mutative-router.vue') },
            { path: 'argument-page', title: '带参页面', name: 'argument-page', icon: 'android-send', component: () => import('@/views/advanced-router/argument-page.vue') }
        ]
    },
    {
        path: '/error-page',
        icon: 'android-sad',
        title: '错误页面',
        name: 'errorpage',
        component: Main,
        children: [
            { path: 'index', title: '错误页面', name: 'errorpage_index', component: () => import('@/views/error-page/error-page.vue') }
        ]
    }*/
];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    preview,
    locking,
    ...appRouter,
    page500,
    page403,
    page404,
    registerRouter
];
